package com.dlc.shop.systemtest.api.order;

import com.dlc.shop.bean.app.dto.MyOrderDto;
import com.dlc.shop.bean.model.Order;
import com.dlc.shop.delivery.common.model.OrderSelfStation;
import com.dlc.shop.systemtest.constants.Constant;
import com.dlc.shop.systemtest.util.HttpUtil;

/**
 * @author xxw
 * @date 2023/2/24 14:23
 */
public class ShopOrderApi {
    /**
     * 商家修改订单价格
     * @param order
     */
    public static void changeAmount(Order order){
        String url = Constant.SHOP_URL+"/order/order/changeAmount";
        HttpUtil.put(url, order);
    }

    /**
     * 根据订单号获取订单信息
     * @param orderNumber
     * @return
     */
    public static Order getOrderByOrderNumber(String orderNumber){
        String url = Constant.SHOP_URL+"/order/order/orderInfo"+"/" +orderNumber;
        return HttpUtil.get(url, Order.class);
    }
    /**
     * 自提订单后台自提
     * */
    public static void changeStatusAndOrderStation(OrderSelfStation orderSelfStation){
        String url = Constant.SHOP_URL+"/admin/station/changeStatusAndOrderStation";
        HttpUtil.put(url, orderSelfStation);
    }

    /**
     * 虚拟订单后台核销
     */
    public static void orderWriteOffByOrderNumber(MyOrderDto myOrderDto){
        String url = Constant.SHOP_URL+"/admin/station/orderWriteOffByOrderNumber";
        HttpUtil.put(url, myOrderDto);
    }
}
